<?php
// load the theme options
$options = get_option( 'complete_theme_settings' );
// get portfolio column count
if($options['portfolio_column'] != '') {
$portfolio_count = $options['portfolio_column'];
} else { $portfolio_count = 'four'; }
?>
<?php get_header(' '); ?>
<div id="main">
	<div id="portfolio-top">
    	<h1 id="page-title"><?php single_cat_title(); ?></h1>
    	<?php echo category_description(); ?> 
    </div>
    <!-- END portfolio-top -->  
<div id="portfolio-wrap">
        <div id="portfolio-<?php echo $portfolio_count ?>-column" class="clearfix">
            <ul id="portfolio-list">
                <?php while (have_posts()) : the_post(); ?>
                <?php $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id(), 'large');  ?>
               <li class="portfolio-box <?php if($terms) {  foreach ($terms as $term) { echo $term->slug . ' '; } } ?>">
                    <div class="portfolio-box-image">
                        <a href="<?php echo $thumbnail[0]; ?>" title="<?php the_title('') ?>" rel="prettyPhoto[gallery]" class="opacity"><?php the_post_thumbnail('portfolio-'. $portfolio_count .'-column'); ?><span class="portfolio-magnify"></span></a>
                        <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" class="portfolio-view-work">→</a>
                    </div>
                    <!-- END portfolio-box-image -->
                   <?php
                    // check if portfolio titles are disabled, otherwise show them
                    if ($options['disable_portfolio_title'] != true) { ?>
                    <h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
                    <?php } ?>
                    <?php
                    // check if portfolio details are disabled, otherwise show them
                    if ($options['disable_portfolio_details'] != true) { ?>
                    <?php echo get_post_meta($post->ID, 'portfolio_description', true); ?>   
                    <?php } ?>
                </li>
                <!-- END portfolio-box -->
                <?php endwhile; ?>
            </ul>
            <!-- END portfolio-list -->
        </div>
        <!-- END portfolio-<?php echo $portfolio_count ?>-column -->
	</div>
	<!-- END portfolio-wrap -->
<?php get_footer(' '); ?>